<template>
  <div class="wrap">
    <div>
      <h1>我是父组件</h1>
      <div>{{ x }}</div>
    </div>
    <div>
      <!-- 向子组件传参 -->
      <Props :send="send" @child="emits"></Props>
    </div>
  </div>
</template>

<script setup>
import Props from "../../components/props";
import {
  ref,
  reactive,
  toRefs,
  onBeforeMount,
  onMounted,
  watchEffect,
  computed,
} from "vue";
//定义父传子的数据
let send = ref("我是父组件传来的数据");

//接收子组件的数据
let x = ref("");
let emits = (val) => {
  x.value = val;
};
</script>
<style scoped>
.wrap {
  width: 500px;
  height: 500px;
}
</style>